package com.dimpt.cloud.dataservice.aaa.dao;

import com.dimpt.cloud.dataservice.aaa.model.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author: zhanglm
 * @Description:
 * @Date: Created in 15:26 2018/3/21
 * @Version: 1.0
 */
@Mapper
public interface UserMapper {
    /**
     * 根据用户名称获取user信息
     *
     * @param username
     * @return Tuser
     */
    List<User> getUserByUsername(String username);

    /**
     * 更新sessionid和time
     *
     * @param user
     * @return void

    @Select("UPDATE t_user SET sessionid=#{sessionid} where username=#{username}")
    void updateSession(User user);
*/
    /**
     * 查询所有用户
     *
     * @return int

    @Select("select username,fullname,level,pwdhash,email,mobilephone,defaultrole,provinceid,defaultregion,enabled,usertype FROM t_user")
    List<User> getUser();
*/
    /**
     * 根据extuserid查询用户
     *
     * @return int

    @Select("select username,fullname,level,pwdhash,email,mobilephone,defaultrole,provinceid,defaultregion,enabled,usertype FROM t_user where extuserid=#{extuserid}")
    User getUserByExtUserId(String extuserid);
 */
    /**
     * 新增一条用户记录
     *
     * @param tuser
     * @return int

    @Insert("INSERT INTO t_user " +
            "(username,fullname,level,pwdhash,email,mobilephone,defaultrole,provinceid,defaultregion,lastupdate,usertype,extuserid)" +
            "VALUES (#{username},#{fullname},#{level},#{pwdhash},#{email},#{mobilephone},#{defaultrole},#{provinceid},#{defaultregion},#{lastupdate},#{usertype},#{extuserid})")
    int insertUser(User tuser);
 */
    /**
     * 更新用户信息
     *
     * @param tuser
     * @return void

    @Update("UPDATE t_user " +
            "SET fullname=#{fullname},level=#{level},pwdhash=#{pwdhash},email=#{email},mobilephone=#{mobilephone},defaultrole=#{defaultrole},provinceid=#{provinceid},defaultregion=#{defaultregion},enabled=#{enabled} " +
            "where username=#{username}")
    int updateUser(User tuser); */
}
